1. Field of the Invention
The invention generally relates to video encoding techniques. In particular, the invention relates to mode selection for macroblocks.
2. Description of the Related Art
A variety of digital video compression techniques have arisen to transmit or to store a video signal with a lower data rate or with less storage space. Such video compression techniques include international standards, such as H.261, H.263, H.263+, H.263++, H.264, MPEG-1, MPEG-2, MPEG-4, and MPEG-7. These compression techniques achieve relatively high compression ratios by discrete cosine transform (DCT) techniques and motion compensation (MC) techniques, among others. Such video compression techniques permit video data streams to be efficiently carried across a variety of digital networks, such as wireless cellular telephony networks, computer networks, cable networks, via satellite, and the like, and to be efficiently stored on storage mediums such as hard disks, optical disks, Video Compact Discs (VCDs), digital video discs (DVDs), and the like. The encoded data streams are decoded by a video decoder that is compatible with the syntax of the encoded data stream.
For relatively high image quality, video encoding can consume a relatively large amount of data. However, the communication networks that carry the video data can limit the data rate that is available for encoding. For example, a data channel in a direct broadcast satellite (DBS) system or a data channel in a digital cable television network typically carries data at a relatively constant bit rate (CBR) for a programming channel. In addition, a storage medium, such as the storage capacity of a disk, can also place a constraint on the number of bits available to encode images.
As a result, a video encoding process often trades off image quality against the number of bits used to compress the images. Moreover, video encoding can be relatively complex. For example, where implemented in software, the video encoding process can consume relatively many CPU cycles. Further, the time constraints applied to an encoding process when video is encoded in real time can limit the complexity with which encoding is performed, thereby limiting the picture quality that can be attained.
One conventional method for rate control and quantization control for an encoding process is described in Chapter 10 of Test Model 5 (TM5) from the MPEG Software Simulation Group (MSSG). TM5 suffers from a number of shortcomings. An example of such a shortcoming is that TM5 does not guarantee compliance with the Video Buffer Verifier (VBV) requirement. As a result, overrunning and underrunning of a decoder buffer can occur, which undesirably results in the freezing of a sequence of pictures and the loss of data.